package com.shengyijie.model.object.Listobject;

import java.util.ArrayList;
import java.util.List;   

import com.shengyijie.model.object.baseobject.AdvertPic;
import com.shengyijie.model.object.baseobject.Category;
import com.shengyijie.model.object.baseobject.GuesstBook;
import com.shengyijie.model.object.baseobject.Item;
 

public class GuesstBookList {

	private int count;
	private List<GuesstBook> list;
	
	public GuesstBookList(){
		list=new ArrayList<GuesstBook>();
		count=0;
	}
	
	 
	public void clear(){
		list.clear();
		count=0;
	}
	public int addItem(GuesstBook item){
		list.add(item);
		count++;
		return count;
	}
	
	public int addItemToFirst(GuesstBook item){
		try{
			List<GuesstBook> temp=new ArrayList<GuesstBook>();
			for(int i=0;i<list.size();i++){
				temp.add(list.get(i));
			}
			list.clear();
			list.add(item);
			for(int i=0;i<temp.size();i++){
				list.add(temp.get(i));
			} 
			count++;
		}catch(Exception e){}
		
		return count;
	}
	
	public GuesstBook getItem(int index){
		return list.get(index);
	}
	 
	public List<GuesstBook> getAllItems()
	{
		return list;
	}
	
	public int getCount(){
		return count;
	}
	
	
	 

	 
}
